﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class WinCheck : MonoBehaviour
{
    public GameObject ChinaWin;
    public GameObject JapanWin;
    public GameObject SpainWin;
    public GameObject WhiteBoard;
    public GameObject RetryButton;
    // Start is called before the first frame update
   public void ReTryButton()
    {
        SceneManager.LoadScene("gym");
        Time.timeScale = 1;
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Time.timeScale = 0;
        if (collision.tag=="dumbbell")
        {
            WhiteBoard.SetActive(true);
            JapanWin.SetActive(true);
            RetryButton.SetActive(true);
        }
        else if(collision.tag == "dumbbell_c")
        {
            WhiteBoard.SetActive(true);
            ChinaWin.SetActive(true);
            RetryButton.SetActive(true);
        }
        else if (collision.tag == "dumbbell_s")
        {
            WhiteBoard.SetActive(true);
            SpainWin.SetActive(true);
            RetryButton.SetActive(true);
        }
    }
}
